From: Florian Müllner Date: Fri, 12 Mar 2021 22:13:25 +0000 (+0100) Subject: shell/app: Expose icon as property X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~107 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=16b0d0d07c11f258f47978d8dfbd110a40508859;p=gnome-shell.git shell/app: Expose icon as property A property can be more convenient than a method. More importantly, we are about to allow the icon to change, so a property will be useful to get notified about those changes. Part-of: --- diff --git a/src/shell-app.c b/src/shell-app.c index d4fe30b0f..d86b05a22 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -93,6 +93,7 @@ enum { PROP_ID, PROP_DBUS_ID, PROP_ACTION_GROUP, + PROP_ICON, PROP_APP_INFO }; @@ -127,6 +128,9 @@ shell_app_get_property (GObject *gobject, case PROP_ID: g_value_set_string (value, shell_app_get_id (app)); break; + case PROP_ICON: + g_value_set_object (value, shell_app_get_icon (app)); + break; case PROP_ACTION_GROUP: if (app->running_state) g_value_set_object (value, app->running_state->muxer); @@ -1645,6 +1649,19 @@ shell_app_class_init(ShellAppClass *klass) NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * ShellApp:icon: + * + * The #GIcon representing this ShellApp + */ + g_object_class_install_property (gobject_class, + PROP_ICON, + g_param_spec_object ("icon", + "GIcon", + "The GIcon representing this app", + G_TYPE_ICON, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** * ShellApp:action-group: *